//package io.github.talelin.latticy.conf;
//
//import lombok.Data;
//import org.elasticsearch.client.RestHighLevelClient;
//import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.data.elasticsearch.client.ClientConfiguration;
//import org.springframework.data.elasticsearch.client.RestClients;
//import org.springframework.data.elasticsearch.config.AbstractElasticsearchConfiguration;
//
//import java.util.List;
//
///**
// * @authoer:wulongbo
// * @createDate:2022/10/8
// * @description:
// */
//
//@Configuration
//@ConfigurationProperties(prefix = "spring.elasticsearch.rest")
//@Data
//public class ElasticsearchConfig extends AbstractElasticsearchConfiguration {
//
//    private List<String> uris ;
//
//    private String username ;
//
//    private String password ;
//
//    //重写父类方法，获取客户端连接
//    @Override
//    @Bean
//    public RestHighLevelClient elasticsearchClient() {
//        final ClientConfiguration clientConfiguration = ClientConfiguration.builder()
//                .connectedTo(uris.toArray(new String[]{}))
//                .withBasicAuth(username,password)
//                .build();
//        return RestClients.create(clientConfiguration).rest();
//    }
//}
//
